package com.dldata.devtools30.controller.api;

import com.dldata.devtools30.service.api.DevtApiMainEntityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Controller
@RequestMapping(value = "/V_DevtApiIndexController")
public class V_DevtApiIndexController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());


    @RequestMapping(value = "/toIndexPage")
    public String toPage(ModelMap model,String apisubtype){
        DevtApiMainEntityService.FunctionType[] functionTypes = DevtApiMainEntityService.FunctionType.values();
        List list=new ArrayList();
        for (int i = 0; i < functionTypes.length; i++) {
            DevtApiMainEntityService.FunctionType functionType = functionTypes[i];
            HashMap hashMap=new HashMap();
            hashMap.put("value",functionType.getValue()+"");
            hashMap.put("lable",functionType.getName());
            list.add(hashMap);
        }
        model.addAttribute("functionTypes",list);
        model.addAttribute("apisubtype",apisubtype);
        return "thymeleaf/devtools30/api/v_DevtApiIndex";
    }


}
